/**
 * 
 */
package io.dora.demo;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zhaohongbo
 *
 */
public class DemoConsumer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
			public void run() {
				System.out.println("jvm shutdown");
			}
		}));
		
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config-consumer.xml");
		/*
		HelloRpc hp = (HelloRpc) context.getBean("helloServiceRpc1");
		
		System.out.println(hp);
		System.out.println(hp == null);
		
		long start = System.currentTimeMillis();
		System.out.println(hp.echoHello(" zhaosizhe"));
		long end = System.currentTimeMillis();
		System.out.println("first:" + (end - start));
		
		
		long start1 = System.currentTimeMillis();
		System.out.println(hp.echoHello(" zhaosizhe2"));
		long end1 = System.currentTimeMillis();
		System.out.println("second:" + (end1 - start1));
		*/
		//context.destroy();
		//System.exit(0);

		
		VoidService voidService = (VoidService) context.getBean("voidService");
		voidService.sayHello("zhaohongbo");
	}

}
